package com.yikaiye.android.yikaiye.ui.adapter;

import android.content.Context;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.DataBindingHolder;
import com.yikaiye.android.yikaiye.R;
import com.yikaiye.android.yikaiye.databinding.ItemReportBinding;
import com.yikaiye.android.yikaiye.model.company.GsBaseInfoModel;

/**
 * 企业年报
 */
public class ReportAdapter extends BaseQuickAdapter<GsBaseInfoModel.CompanyReportModel, DataBindingHolder<ItemReportBinding>> {

    @NonNull
    @Override
    protected DataBindingHolder<ItemReportBinding> onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
        return new DataBindingHolder<>(R.layout.item_report, viewGroup);
    }

    @Override
    protected void onBindViewHolder(@NonNull DataBindingHolder<ItemReportBinding> itemReportBindingDataBindingHolder, int i, @Nullable GsBaseInfoModel.CompanyReportModel companyReportModel) {
        ItemReportBinding binding = itemReportBindingDataBindingHolder.getBinding();
        if (companyReportModel != null) {
            binding.tvReportName.setText(companyReportModel.getReportName());
            binding.tvReportDate.setText(companyReportModel.getReportDate());
        }
    }
}
